package com.changgou.service.goods.controller;

import com.changgou.goods.pojo.Spec;
import com.changgou.service.goods.service.SpecService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/spec")
@CrossOrigin
public class SpecController {

    @Autowired
    private SpecService specService;


    @GetMapping("/searchSpec/{categoryName}")
    public List<Spec> findSpecByCategoryName(@PathVariable("categoryName") String categoryName) {
        return specService.findSpecByCategoryName(categoryName);
    }
}
